package com.sxran.im.handler;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.sxran.im.controller.ImController;
import com.sxran.im.dao.ImUserMapper;
import com.sxran.im.info.ImUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@Slf4j
public class SearchUserListHandler extends AbstractCmdHandler<String>{


    @Resource
    private ImUserMapper imUserMapper;

    @Override
    public Object doBeanService(String bean) {
        LambdaQueryWrapper<ImUser> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.ne(ImUser::getUserId, ImController.getCurUserId());
        List<ImUser> imUsers = imUserMapper.selectList(queryWrapper);
        return imUsers;
    }
}
